@Override
    public DataEntity<Object> cusSettlementCode(ProjectSettleConfDTO.ListPage.Input input) {
        if (ObjectUtil.isNull(input) || ObjectUtil.isNull(input.getCreateDateStart()) || ObjectUtil.isNull(input.getCreateDateEnd())) {
            log.info("定时器扫描cusSettlementCode 为null接口 请求入参异常！，确少参数：CreateDateStart or CreateDateEnd");
            return DataEntity.ok(null);
        }
        log.info("定时器扫描cusSettlementCode, 入参：{}", JSONUtil.toJsonStr(input));

        int pageSize = 200;
        input.setLimit(pageSize);

        int count = cusSettleDetailMapper.selectSettlementCodeIsNullCount(input);
        if (count == 0) {
            return DataEntity.ok(null);
        }

        int size = (int) Math.ceil((double) count / pageSize);
        for (int i = 0; i < size; i++) {
            List<SettleCusDetail> details = cusSettleDetailMapper.selectSettlementCodeIsNull(input);
            if (CollUtil.isEmpty(details)) {
                return  DataEntity.ok(null);
            }

            SettleCusDetail max = details.get(details.size()-1);
            if (ObjectUtil.isNotEmpty(max)) {
                input.setLimitId(max.getId());
            }

            List<SettleCusDetail> updateDetails = new ArrayList<>(details.size());

            Map<String, List<SettleCusDetail>> groupMap = details.stream().collect(Collectors.groupingBy(SettleCusDetail::group));
            for (Map.Entry<String, List<SettleCusDetail>> entry : groupMap.entrySet()) {
                SettleCusDetail settleCusDetail = entry.getValue().get(0);
                ProjectSettleConfDTO.ListPage.selectTimer selectTimer = new ProjectSettleConfDTO.ListPage.selectTimer();
                BeanUtil.copyProperties(settleCusDetail,selectTimer);

                ProjectSettleConf conf = projectSettleConfService.selectTimer(selectTimer);
                if (ObjectUtil.isNull(conf)) {
                    log.info("cus定时器扫描SettlementCode，分组：{}，结算编码为未确认！", entry.getKey());
                    continue;
                }

                List<SettleCusDetail> value = entry.getValue();
                for (SettleCusDetail cusDetail : value) {
                    cusDetail.setSettlementCode(conf.getSettlementCode());
                    cusDetail.setErrorCode(SettleErrorType.SUCCESS.getCode());
                }
                updateDetails.addAll(value);
            }
            if (CollUtil.isNotEmpty(updateDetails)) {
                settleCusDetailDao.updateBatch(updateDetails);
            }
        }
        return DataEntity.ok(null);
    }



     <select id="selectSettlementCodeIsNull" resultType="cn.com.dragonpass.infra.settle.entity.SettleCusDetail"
            parameterType="cn.com.dragonpass.settle.model.dto.project.ProjectSettleConfDTO$ListPage$Input">
        select *
        from settle_cus_detail
        where error_code = 'settlement_code_null'
        and settle_time <![CDATA[ >= ]]>  #{createDateStart}
        and settle_time <![CDATA[ <= ]]>  #{createDateEnd}
        <if test="limitId != null ">
            and id > #{limitId}
        </if>
        order by id asc
        <if test="limit != null">
            limit #{limit}
        </if>
    </select>

    <select id="selectSettlementCodeIsNullCount" resultType="java.lang.Integer"
            parameterType="cn.com.dragonpass.settle.model.dto.project.ProjectSettleConfDTO$ListPage$Input">
        select count(1)
        from settle_cus_detail
        where error_code = 'settlement_code_null'
        and settle_time <![CDATA[ >= ]]>  #{createDateStart}
        and settle_time <![CDATA[ <= ]]>  #{createDateEnd}
    </select>


    --------------------------------第2钟方式

     public void pushRequestConfiV2() {
        RLock lock = redissonClient.getLock("pushRequestConfiV2");
        lock.lock();
        try {
            Integer curId = null;
            Queryable<SettleIncomeCostSap> result;

            boolean hasMoreData = true;
            while (hasMoreData) {
                Integer maxId = curId;
                result = settleIncomeCostSapDao.where(w -> {
                    w.setIfPushSap("N");
                    w.setDebitCreditCode("H");
                    if (maxId != null) {
                        w.setId(gt(maxId));
                    }
                });
                List<SettleIncomeCostSap> settleIncomeCostSaps = result.orderByAsc((w -> list(w.getId()))).toList(limit);
                if (CollectionUtil.isEmpty(settleIncomeCostSaps)) {
                    hasMoreData = false;
                } else {
                    // 获取settleIncomeCostSaps集合 最后一个ID
                    curId = settleIncomeCostSaps.get(settleIncomeCostSaps.size() - 1).getId();

                    try {
                        this.incomeCostSapPushToSAP(settleIncomeCostSaps);
                    } catch (Exception e) {
                        log.error("创建日记账分录失败【Cause={} - Message={} stackTrace={}】", e.getCause(), e.getMessage(), Arrays.deepToString(e.getStackTrace()));
                        break;
                    }
                }
            }
        } finally {
            if (lock != null) {
                lock.unlock();
            }
        }
    }